<?php 

	include_once("./head.php");
	include_once("./commonality.php");
	error_reporting(E_ALL^E_NOTICE^E_WARNING);
	date_default_timezone_set("PRC");
	session_start();
	echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
	$sql="select * from ts_order where uid = {$_SESSION['uid']}";
	$rea=mysql_query($sql);
	while ($abc=mysql_fetch_assoc($rea)) {
	    $list[]=$abc;
	}	
	//
	$sql="select * from goods g,product p where uid = {$_SESSION['uid']} and g.pid=p.pid";
	$rea=mysql_query($sql);
	while ($ert=mysql_fetch_assoc($rea)) {
	    	$ser[]=$ert;
	}
	
 ?>
<!DOCTYPE html>
 <html>
 <head>
 	<title></title>
 </head>
	<style>
	.c1{
		width:10%;
		height:40px;
		/*border:1px solid red;*/
		margin-left:60px;
		font-size:18px;

	}
	.haha{
	margin-left:150px;
	}
	.color9{
		width:30px;
		height:30px;
		display:inline-block;
	}
	th{
		color:blue;

	}
	</style>
 <body>
	<span class="c1">当前所在：商城>订单列表</span><hr color="#d1d1d1"><br><br>
	<div class="haha">
	<table border=0px solid #AAAAB4 width="80%" height="50px" cellspacing="20px">
	<?php foreach ($list as $key=>$value){ ?>
	<tr align="center">
		<th width="10%">订单号</th>
		<th width="10%">下单时间</th>
		<th width="10%">总价</th>
		<th width="10%">状态</th>
	</tr>	
	<tr align="center">
	  <td><?= $value['order_sn'] ?></td>
	  <td><?= $value['order_time'] ?></td>
	  <td><?= $value['subtotal'] ?></td>
	  <td>
	 <?php if($value['delivery_status']==0) {?>
			未发货
	 <?php }elseif($value['delivery_status']==1) { ?>
	 		已发货
	 <a href="admin/order_edit.php?order_id=<?= $value['order_id']?>&type=2">确认收货？</a>	
	 <?php }elseif($value['delivery_status']==2) { ?>
			已收货
	<?php } ?>
	  </td>
	 </tr>
	<tr align="center">
		<th>图片</th>
		<th>颜色</th>
		<th>尺寸</th>
		<th>
		<?php if($value['delivery_status']==2){ ?>
			<a href="pinglun.php?order_id=<?= $value['order_id'] ?>">评论</a>
		<?php } ?>		
		</th>
	</tr>
	<?php foreach ($ser as $k=>$v) { 
	if($value['order_sn']==$v['order_sn']){ ?>
	<tr align="center">
		<td><img src="./uploads/<?= $v['pimg']?>" width="30px"></td>
		<td><div class="color9"style="background:<?= $v['gcolor'] ?>"></div></td>
		<td><?= $v['gsize'] ?></td>
	</tr>
	<?php } }?>
	<?php }?>
	</table>
	</div>
 </body>
 </html>